<?php

namespace Mvc\App\Model;

use Mvc\Core\Factory;
use Mvc\Core\Model\Model;

/**
 * Created by PhpStorm.
 * User: 554665488
 * Date: 2018-6-22
 * Time: 5:36
 * @description:
 * @Author: yfl
 * @QQ 554665488
 */
class User extends Model
{
    //使用代理在从数据库里边查询数据
    public function getInfo($id)
    {
        return Factory::getDatabase()->query("select * from user where id =$id limit 1")->fetch_assoc();
    }

    function create($user)
    {
        //insert to database
        $userid = 1;
        $this->notify($user);
        return $userid;
    }
}